<?php
namespace classes\bank;
use classes\bank\BankProduct;
use utils\BankUtils;

class Credit extends BankProduct
{
	private $monthlyPayment;
	
	public function __construct($accountNumber, $yearlyInterestRate, $periodInMonts, $nalichnost){
	
		parent::__construct($accountNumber, $yearlyInterestRate, $periodInMonts, $nalichnost);
		$this->monthlyPayment += BankUtils::calculateCreditMontlyPayment($nalichnost, $yearlyInterestRate, $periodInMonts);	
	}
	
	public function showInfo(){
		
		echo "<b>Report for Credit {$this->getAccountNumber()}: </b><br>";
		parent::showInfo();
		echo "<br>";
	}
	
	public function getMonthlyPayment(){
		return $this->monthlyPayment;
	}
}
?>	
